<template>
  <el-dialog
    class="collect-preview"
    title="文章预览"
    :visible.sync="dialogVisible"
    fullscreen
  >
    <div class="webheart collect-content">
      <p class="cite-title">{{ row.citeTitle }}</p>
      <h2 class="collect-title">{{ row.title }}</h2>
      <p class="sub-title">{{ row.subTitle }}</p>
      <p class="collect-info">
        <!-- <span v-if="row.source">来源：{{ row.source }}</span> -->
        <span v-if="row.author1">作者：{{ row.author1 }}</span>
        <span v-if="row.classifyNames">栏目：{{ row.classifyNames }}</span>
        <span v-if="row.executiveEditor"
          >责任编辑：{{ row.executiveEditor || '--' }}</span
        >
        <span>创建时间：{{ row.createTime }}</span>
      </p>
      <div class="pdf-show">
        <!-- <PdfShow :fileList="row.fileList" v-if="dialogVisible" /> -->
        <div v-for="item in row.fileList" :key="item.id">
          <iframe
            style="width: 100%; height: 1000px; border: 0px; overflow: hidden"
            width="100%"
            height="1000px"
            :src="item.httpUrl"
          ></iframe>
        </div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="info" @click="dialogVisible = false">关 闭</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  components: {
    PdfShow: () => import('./PdfShow.vue'),
  },
  data() {
    return {
      dialogVisible: false,
      row: {},
    }
  },
  mounted() {
    this.$bus.$on('collectLogPreview', (row) => {
      this.row = row
      this.dialogVisible = true
    })
  },
  beforeDestroy() {
    this.$bus.$off('collectLogPreview')
  },
  methods: {},
}
</script>
<style scoped lang="scss">
.collect-content {
  height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  .pdf-show {
    position: relative;
    height: 670px;
  }
}
.collect-title {
  text-align: center;
  line-height: 2;
  color: #333;
  font-size: 22px;
}
.cite-title {
  color: #666;
  font-size: 16px;
  text-align: center;
}
.sub-title {
  color: #666;
  text-align: center;
  margin-top: -10px;
}
.collect-info {
  text-align: center;
  margin-bottom: 20px;
  span {
    margin: 0 10px;
  }
}
.outline {
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 3px dashed #eee;
}
.collect-info-end {
  text-align: right;
  margin-top: 10px;
  margin-bottom: 20px;
  span {
    margin: 0 10px;
  }
}
</style>
<style scoped>
.collect-preview >>> .el-dialog__footer {
  background: #fff;
}
.collect-preview >>> .el-dialog__body {
  border-top: 1px solid #ddd;
  background: #fff;
}
</style>